package com.xbongbong.pay.platform.unionpay.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * 银联配置容器
 * @author 魏荣杰
 * @date 2021/1/20 14:27
 * @since
 * @version
 */
public class UnionPayMetaContainer {
    private static final Logger LOG = LoggerFactory.getLogger(UnionPayMetaContainer.class);

    private final Map<String, UnionPayMeta> unionPayMetaMap = new HashMap<>();


    public UnionPayMetaContainer addUnionPayMeta(UnionPayMeta unionPayMeta) {
        unionPayMetaMap.put(unionPayMeta.getId(), unionPayMeta);
        return this;
    }

    public UnionPayMeta getUnionPayMeta(String id) {
        return Objects.requireNonNull(unionPayMetaMap.get(id));
    }
}
